package org.zdd.bookstore.model.dao;

import org.zdd.bookstore.common.utils.MyMapper;
import org.zdd.bookstore.model.entity.User;

public interface UserMapper extends MyMapper<User> {
    /**
     * 插入数据
     * @param user
     */
    void insertUser(User user);

    /**
     * 根据邮箱查询
     * @param email
     * @return
     */
    User queryByEmail(String email);

    /**
     * 登录
     * @param user
     * @return
     */
    User selectUser(User user);

    /**
     * 检验username和email是否存在
     * @param user
     * @return
     */
    User selectUserByUsername(User user);

    Integer updateUserPassword(User user);

    /**
     * 获取当前用户id
     * @param username
     * @return
     */
    User selectByName(String username);

    void deleteById(int userId);


}